﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Sio.Mdm.Server.ServerCommands
{
    class JobScheduler : Administration.ServerCommand
    {
        public JobScheduler()
            : base("schedule")
        {
        }

        public override string Description
        {
            get
            {
                return "Schedule services at regular occurences";
            }           
        }

        /// <summary>
        /// Schedule service with arguments
        /// </summary>
        /// <returns></returns>
        public override bool Execute()
        {
            Utils.CommandLineHelper helper = 
                new Sio.Mdm.Utils.CommandLineHelper(Parameters);

            if (!helper.HasParameter("schedule"))
            {
                throw new ArgumentException("Schedule time is not specified.");
            }

            return base.Execute();
        }
    }
}
